<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>综合练习-2</title>
</head>
<body>
<div>
  <table border="1">
    <caption>个人信息</caption>
    <tr>
      <td>照片：</td>
      <td ><img :src="person.url" width="100" > </td>
    </tr>
    <tr>
      <td>姓名：</td>
      <td>{{person.name}}</td>
    </tr>
    <tr>
      <td>年龄：</td>
      <td>{{person.age}}</td>
    </tr>
    <tr>
      <td>好友：</td>
      <td><ul><li v-for="friendsName in person.friends">{{friendsName}}</li></ul></td>
    </tr>
  </table>
  <input type="button" value="加载资源" @click="f()">
</div>
<script src="http://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
  let v = new Vue({
    el:"body>div",
    data:{
      person:{}
    },
    methods:{
      f(){
        v.person = {name:"刘桑",age:55,url:"../t.jpg",friends:["传奇","克晶","国斌"]}
      }
    }
  })
</script>
</body>
</html>